package judge;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import service.serviceI.JudgeService;
import service.serviceI.serviceImpl.JudgeServiceImpl;
import service.vo.MessageVO;
import struts.action.Action;
import struts.form.ActionForm;

public class JudgeAction implements Action{

	@Override
	public String execute(HttpServletRequest request,HttpServletResponse response,ActionForm form, Map<String, String> actionForward) {
		String name = request.getParameter("text");
		String url = "";
		JudgeService service = new JudgeServiceImpl();
		Map<String, MessageVO> map = service.getVO(name);
		Set<String> set = map.keySet();
		for(Iterator<String> it = set.iterator(); it.hasNext();){
			url = it.next();
			request.setAttribute("mess", map.get(url));
		}
		return url;
	}

}
